﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteNew.Master" Inherits="System.Web.Mvc.ViewPage<ASPNETMVCApplication.Areas.Shop.Models.SearchCategoryModel>" %>


<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	SearchCategory
   
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   <script>
       $(function () {
           $("button, input:submit,input:text,.details").button();

       });
	</script>
 <script>
     $(function () {
         $("#DateFrom").datepicker(
        {
            changeMonth: true,
            changeYear: true,
            showOn: "button",
            buttonImage: "/Assets/images/calendar.gif",
            buttonImageOnly: true
        }
        );
     });
	</script>
    <script>
        $(function () {
            $("#DateTo").datepicker(
            {
                changeMonth: true,
                changeYear: true,
                showOn: "button",
                buttonImage: "/Assets/images/calendar.gif",
                buttonImageOnly: true
            }
            );
        });
	</script>


     <% using (Html.BeginForm("SearchCategory", "Product", FormMethod.Post))
       {%>
        <%: Html.ValidationSummary(true) %> 
    
    <h2>SearchCategory</h2>
    <div id="page-heading" class="ui-state-default">
        <table style="width: 80%;">
        <tr>
            <td style="width: 200px" >
                &nbsp;
            <strong>Từ ngày</strong></td>
            <td style="width: 200px">
	<strong>Đến ngày
	</strong></td>
            <td>
            <strong>Bến Đi</strong></td>
            <td>
               <strong> Bến đến</strong></td>
            <td>
               <strong>Nhà xe</strong></td>
            <td>
                <strong>Chọn xe</strong></td>
            <td >
                
            </td>
        </tr>
        <tr>
            <td  >
               <%: Html.TextBoxFor(model => model.DateFrom) %>
            </td>
            <td >
                <%: Html.TextBoxFor(model => model.DateTo) %></td>
            <td>
                <select name="FirstPoint" >
                    <option value="1">BS</option>
                    <option value="2">HCM</option>
                </select>
            </td>
            <td>
                <select name="LastPoint" >
                    <option value="1">BS</option>
                    <option value="2">HCM</option>
                </select></td>
            <td>
               <%: Html.DropDownList("SupplierId", (IEnumerable<SelectListItem>)ViewData["ListSupp"])%></td>
            <td>
                <%: Html.TextBoxFor(model => model.TrafficId) %></td>
                <td><input  type="submit" value="Tìm vé"></td>
        </tr>
        
    </table>
    </div>
  

    <% } %>
     <% if (ViewData["ListTick"] != null)
                     {%>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table" >
	<tbody><tr>
		<th rowspan="3" class="sized">
            <img src="../../../../Assets/Images/shared/side_shadowleft.jpg" width="20" 
                height="300" alt=""></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized">
            <img src="../../../../Assets/Images/shared/side_shadowright.jpg" width="20" 
                height="300" alt=""></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td>

		<div id="content-table-inner">
		

			<div id="table-content">

              <%
                        List< ASPNETMVCApplication.Areas.Supp.ViewModels.ProductViewModels> proc = (List<ASPNETMVCApplication.Areas.Supp.ViewModels.ProductViewModels>)ViewData["ListTick"];
                         for (int j = 0; j < proc.Count;j++ )
                         {
                             //for (int xe = 0; xe < proc[j].ListCate.Count;xe++ )
                             //{
             %> <% using (Html.BeginForm("TicketBuy", "Product", FormMethod.Post))
                   {%>
                         	    
            <table border="0" cellpadding="0" cellspacing="0" id="product-table">
				
					<tbody><tr>
					<td width="15%" height="120"><div class="logosupplier">
                        <img src="/Assets/Images/shared/car.png" alt="" /></div></td>
				  <td width="85%">
                  
                  <!--Show Ticket SearchCategory-->
                    <h4><%: proc[j].Supp.CompanyName%>
                        <%: Html.Hidden("SuppID",proc[j].Supp.SupplierId) %>
                        <%: Html.Hidden("CateID",proc[j].ListCate[j].CategoryId) %>
                    </h4>
                   <table width="100%" style="border:0px;" border="0">
  <tbody><tr>
    <td colspan="11"><p><strong>Số xe : <%: proc[j].ListCate[j].TrafficId%></strong> - <strong style="color:#900">Ngày chạy <%: proc[j].ListCate[j].Date%> - </strong>Tuyến :Sài gòn - Bồng sơn - Giờ chạy : <%: proc[j].ListCate[j].StartTime%>  - Liên hệ nhà xe : <%: proc[j].Supp.CompanyPhone%></p></td>
  </tr>
  <tr><td colspan="11"><h4>Sơ đồ ghế :</h4></td></tr>
 
       
     <%
                    for (int indexDay = 1; indexDay <5; indexDay++)
                    {
                       
         %>
        <tr>
            <% int indexCot = 0;
               int soghe = indexDay;
               while (soghe <= proc[j].ListProc.Count)
               {
                   
                   if (proc[j].ListProc[soghe-1].Status != 0)
                   {
                   %>
                   
                   <td><%--<%: Html.Hidden(proc[j].ListProc[soghe-1].ChairNumber.ToString(), false, new { @readonly = "readonly", @disabled = "disabled" })%>--%>
                   <img src="/Assets/Images/table/checked.png" width="16" height="16" alt="" /><b style="color:#0073EA"><%: soghe%></b></td>
                   <% 
                    }
                   else
                   {
                        %>
                        <td><%--<%: Html.CheckBox(, false)%>--%>
                        <input type="checkbox" id="check<%: proc[j].ListProc[soghe - 1].ChairNumber.ToString() %>" name="check<%: proc[j].ListProc[soghe - 1].ChairNumber.ToString() %>" />
                   <b style="color:Maroon"><%: soghe%></b></td>
                        <%
                   }
                   indexCot += 1;
                   soghe = indexDay + indexCot * 4;
               }
               
          %>
  
        </tr>  
  <%
                    }
    %>
  
 
 
 <tr><div style="margin-top:10px; margin-bottom:5px;">
 <input type="submit" value="Đưa vào giỏ"></div></tr>
 
</tbody></table> 		
</td>
				</tr>
				
				
				</tbody></table>
                           <%
                    }
            //  }
} 
            %>
            </div>

			<!-- end actions-box........... -->
			
			<!--  start paging..................................................... -->
			<!--  end paging................ -->
			
			<div class="clear"></div>
		 
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</tbody></table>
     <%
                     }
                         
                          %>
</asp:Content>

